
$(document).ready(function() {
	$('form').validate();
	
	dibujarCancha();
	
});

function limpiarInputs() {
	$('input[type=text]').empty();
	$('input[type=text]').removeClass("error");
	$('label.error').hide();
}

function dibujarCancha() {
	
	var cancha = '<div style="position:absolute; top:0; left:0; width:231px; height:24px;"></div>' +
		'<div style="position:absolute; top:0; left:233px; width:231px; height:24px;"></div>' +
		'<div style="position:absolute; bottom:0; left:0; width:231px; height:24px;"></div>' +
		'<div style="position:absolute; bottom:0; left:233px; width:231px; height:24px;"></div>' +
//		<!-- backcourts -->
		'<div style="position:absolute; top:26px; left:0; width:106px; height:160px;"></div>' +
		'<div style="position:absolute; top:26px; right:0; width:106px; height:160px;"></div>' +
//		<!-- service courts -->
		'<div style="position:absolute; top:26px; left:108px; width:123px; height:79px;"></div>' +
		'<div style="position:absolute; top:26px; right:108px; width:123px; height:79px;"></div>' +
		'<div style="position:absolute; bottom:26px; left:108px; width:123px; height:79px;"></div>' +
		'<div style="position:absolute; bottom:26px; right:108px; width:123px; height:79px;"></div>' +
//		<!-- center marks: workaround IE min-height -->
		'<div class="tick" style="position:absolute; top:106px; left:1px;"></div>' +
		'<div class="tick" style="position:absolute; top:106px; right:1px;"></div>';
	
	$('#cancha').html(cancha);
	$('#cancha').addClass("cancha");
	
}